// PHSApp.cpp: implementation of the CPHSApp class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "PHSApp.h"
#include "phscaculatesetting.h"
#include "phsbasepointsetting.h"
#include "phsdrawsetting.h"
#include "phsrecentwork.h"
#include "phsdirectorysetting.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
 

IMPLEMENT_SINGLETON(CPHSApp);

CPHSApp::CPHSApp()
{
	m_strDefaultSHBlock = _T("SHPoint.dwg");
	m_strDefaultPrjName = _T("default");
	m_strDefaultPrjVersion = _T("AutoPHS7.0");
	m_strMenuName = _T("UE_PHS");
	m_strJointFormerName = _T("JointFormer.mdb");
	m_strDefaultDrawSpecName = _T("default");
}

CPHSApp::~CPHSApp()
{
}

CPHSApp* GetPHSApp()
{
	return CPHSApp::Instance();
}

BOOL CPHSApp::InitApplication()
{
//	GetCurCaculateSetting().InitSetting();
//	GetCurDrawSetting().InitSetting();
//	GetRecentWork().InitSetting();
	m_strCurSpecName = PHSRegEdit().GetRegKey(_T("Settings"), _T("EDinBox_CDSN"), m_strDefaultDrawSpecName);

	return GetCurDirectorySetting().InitSetting();
}


void CPHSApp::SaveApplication()
{
	PHSRegEdit().SetRegValue(_T("Settings"), _T("EDinBox_CDSN"), m_strCurSpecName);
//	GetCurCaculateSetting().SaveSetting();
//	GetCurDrawSetting().SaveSetting();
//	GetRecentWork().SaveSetting();
//	GetCurDirectorySetting().SaveSetting();
}
